<script type="text/javascript">
	var appendName = function(){
		console.log("-----------------");
		var selectedValue = $("#groupMember").val();
		$("#groupMemberValues").val($("#groupMemberValues").val()+"-" + selectedValue);
	}

	$(function() {
		ClassicEditor
			.create( document.querySelector( '#editor' ) )
			.then( editor => {
					console.log( editor );
			} )
			.catch( error => {
					console.error( error );
			} );
	});
</script>
<fieldset class="solid">
	<legend>添加</legend>
	<input type="hidden" name="tbTask.id" value="#(tbTask.id??)" />
	<div>
		<label>日期</label>
		<input type="date" name="tbTask.reportDate" value="#date(tbTask.reportDate??,'yyyy-MM-dd')"/>
	</div>
	<div>
		<label>名称</label>
		<input type="text" name="tbTask.title" value="#(tbTask.title??)"/>
	</div>
	<div>
		<label>金额</label>
		#if(session.uid.id == 1)
			<input type="text" name="tbTask.money" value="#(tbTask.money??)"/>
		#else
			<input type="text" name="tbTask.money" disabled value="#(tbTask.money??)"/>
		#end
	</div>
	<div>
		<label>项目名称</label>
		<input type="text" name="tbTask.projectName" value="#(tbTask.projectName??)"/>
	</div>
	<div>
		<label>任务领取人</label>
		<input type="text" name="tbTask.userName" value="#(tbTask.userName??)"/>
	</div>
	<div>
		<label>选择组员</label>
		<select onchange="appendName()" id="groupMember">
			#for(x : users)
			<option value="#(x.realName)">#(x.realName)</option>
			#end
		</select>
		<input type="text" id="groupMemberValues" name="tbTask.groupMembers" value="#(tbTask.groupMembers??)"/>
	</div>
	<div>
		<label>是否完成</label>
		<select name="tbTask.complete">

			#if(tbTask!= null && tbTask.complete != null && tbTask.complete)
			<option value="true" selected>是</option>
			<option value="false">否</option>
			#else
			<option value="true">是</option>
			<option value="false" selected>否</option>
			#end
		</select>
	</div>
	<div>
		<label>是否重要</label>
		<select name="tbTask.important">
			#if(tbTask!= null && tbTask.important??)
			<option value="true" selected>是</option>
			<option value="false">否</option>
			#else
			<option value="true" selected>是</option>
			<option value="false">否</option>
			#end
		</select>
	</div>
	<div>
		<label>是否紧急</label>
		<select name="tbTask.emergency">
			#if(tbTask!= null && tbTask.emergency??)
			<option value="true" selected>是</option>
			<option value="false">否</option>
			#else
			<option value="true">是</option>
			<option value="false" selected>否</option>
			#end
		</select>
	</div>
	<div>
		<label>权重</label>
		<input type="text" name="tbTask.weight" value="#(tbTask.weight??)"/>
	</div>
	<div>
		<label>类别</label>
		<input type="text" name="tbTask.category" value="#(tbTask.category??)"/>
	</div>
	<div>
		<label>计划完成日期</label>
		<input type="date" name="tbTask.reportDate" value="#date(tbTask.reportDate??,'yyyy-MM-dd'??)"/>
	</div>
	<div>
		<label>任务描述</label>
		<textarea id="editor" name="tbTask.content" rows="10" cols="50">#(tbTask.content??)</textarea>
	</div>
	<div>
		<label>备注</label>
		<textarea name="tbTask.summary" rows="10" cols="50">#(tbTask.summary??)</textarea>
	</div>
	<div>
		<label>&nbsp;</label>
		<input value="提交" type="submit">
	</div>
</fieldset>